package com.jgj.zxkj.lookandcheckjggroupinfo;

import android.support.test.espresso.action.ViewActions;
import android.support.test.filters.LargeTest;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;

import com.jgj.zxkj.lookandcheckjggroupinfo.record.HomeActivity;

import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
import static android.support.test.espresso.action.ViewActions.typeText;
import static android.support.test.espresso.matcher.ViewMatchers.withId;

/**
 * Cred by all-cui on 2017/11/1.
 */
@RunWith(AndroidJUnit4.class)
@LargeTest
public class LgginActivityInstrumentationTest {
    private static final String STRING_TO_BE_TYPED = "dd";
    private static final String PASSWORD = "123456";

    @Rule
    public ActivityTestRule<HomeActivity> mActivityRule = new ActivityTestRule<>(
            HomeActivity.class);

    @Test
    public void test() {
        //填写账号
        onView(withId(R.id.et_sign_in_account)).perform(typeText(STRING_TO_BE_TYPED), closeSoftKeyboard()); //line 1
        //填写密码
        onView(withId(R.id.et_sign_in_pwd)).perform(typeText(PASSWORD),closeSoftKeyboard());

        onView(withId(R.id.bt_sign_in)).perform(ViewActions.click()); //line 2

    }
}
